package com.example.demo;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

@SpringBootTest
class DemoApplicationTestsTwoDatasource {

    @Test
    void contextLoads() {
//        System.out.println(dataSource.getClass());
    }

    @Autowired
    private JdbcTemplate db1JdbcTemplate;

/*
    @Autowired
    private DataSource dataSource;
*/


    @Test
    public void insertData(){

        String sql = "insert into user(id,userName,password,age) values(5576,'zhangsan','123456',3453)";
        db1JdbcTemplate.execute(sql);
    }

}
